unit RelatorioOcorrenciaNotaFiscal;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, UFormRelatorio, DB, DBTables, StdCtrls, QRCtrls, QuickRpt,
  ExtCtrls;

type
  TFRelatorioOcorrenciaVendaNotaFiscal = class(TFormRelatorio)
    QRLabel4: TQRLabel;
    QRLabel5: TQRLabel;
    QRLabel6: TQRLabel;
    QRLabel7: TQRLabel;
    QRLabel8: TQRLabel;
    QRLabel10: TQRLabel;
    QRLabel11: TQRLabel;
    QRBand2: TQRBand;
    QRDBText2: TQRDBText;
    QRDBText3: TQRDBText;
    QRExpr1: TQRExpr;
    QRDBText4: TQRDBText;
    QRExpr2: TQRExpr;
    QRDBText5: TQRDBText;
    QRDBText7: TQRDBText;
    QRDBText8: TQRDBText;
    QRDBText9: TQRDBText;
    QRDBText10: TQRDBText;
    QRDBText11: TQRDBText;
    QRDBText12: TQRDBText;
    QRDBText13: TQRDBText;
    QRLabel13: TQRLabel;
    QRLabel16: TQRLabel;
    QRDBText14: TQRDBText;
    QRDBText15: TQRDBText;
    QRDBText16: TQRDBText;
    QRDBText17: TQRDBText;
    QRDBText23: TQRDBText;
    QRDBText24: TQRDBText;
    QRLabel65: TQRLabel;
    QRExpr7: TQRExpr;
    QRExpr8: TQRExpr;
    QRExpr9: TQRExpr;
    QRExpr10: TQRExpr;
    QRExpr11: TQRExpr;
    QRExpr12: TQRExpr;
    QRExpr13: TQRExpr;
    QRDBText1: TQRDBText;
    QRLabel12: TQRLabel;
    QRExpr3: TQRExpr;
    QRLabel20: TQRLabel;
    QRLabel22: TQRLabel;
    QRLabel15: TQRLabel;
    QRLabel17: TQRLabel;
    QRLabel21: TQRLabel;
    QRLabel23: TQRLabel;
    QRLabel18: TQRLabel;
    QRLabel19: TQRLabel;
    QRLabel43: TQRLabel;
    QRLabel44: TQRLabel;
    QRLabel9: TQRLabel;
    QRLabel33: TQRLabel;
    QRLabel38: TQRLabel;
    QRLabel39: TQRLabel;
    QRLabel66: TQRLabel;
    QRLabel68: TQRLabel;
    QRLabel64: TQRLabel;
    QRShape1: TQRShape;
    QRBand3: TQRBand;
    QRExpr4: TQRExpr;
    QRLabel25: TQRLabel;
    QRLabel14: TQRLabel;
    QRLabel26: TQRLabel;
    QRLabel27: TQRLabel;
    QRLabel28: TQRLabel;
    QRLabel29: TQRLabel;
    QRLabel30: TQRLabel;
    QRExpr5: TQRExpr;
    QRExpr6: TQRExpr;
    QRExpr14: TQRExpr;
    QRExpr15: TQRExpr;
    QRExpr16: TQRExpr;
    QRExpr17: TQRExpr;
    QRExpr18: TQRExpr;
    QRLabel31: TQRLabel;
    QRExpr19: TQRExpr;
    QRLabel32: TQRLabel;
    QRLabel34: TQRLabel;
    QRLabel24: TQRLabel;
    QRLabel35: TQRLabel;
    QRLabel36: TQRLabel;
    QRLabel37: TQRLabel;
    QRLabel40: TQRLabel;
    QRLabel41: TQRLabel;
    QRLabel42: TQRLabel;
    QRExpr22: TQRExpr;
    QRExpr23: TQRExpr;
    QRExpr24: TQRExpr;
    QRExpr25: TQRExpr;
    QRExpr26: TQRExpr;
    QRExpr27: TQRExpr;
    QRExpr28: TQRExpr;
    QRExpr29: TQRExpr;
    QRShape2: TQRShape;
    procedure FormCreate(Sender: TObject);
    procedure QuickRep1EndPage(Sender: TCustomQuickRep);
    procedure QRBand1BeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
    procedure QRBand3BeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
    procedure QRLabel3Print(sender: TObject; var Value: String);
  private
    { Private declarations }
  public
    { Public declarations }
   encolhe :boolean ;
  end;

var
  FRelatorioOcorrenciaVendaNotaFiscal: TFRelatorioOcorrenciaVendaNotaFiscal;

implementation

uses UGeral, PesquisaOcorrenciaNotaFiscal;

{$R *.dfm}

procedure TFRelatorioOcorrenciaVendaNotaFiscal.FormCreate(Sender: TObject);
begin
  inherited;
 QRelatorio.Close;
 QRelatorio.SQL.Clear;
 QRelatorio.SQL.Add('Select Emp_Razao as Razao from empresa ');
 QRelatorio.SQL.Add('Where Emp_Codigo = :Cod ');
 QRelatorio.ParamByName('Cod').AsInteger:=Codigoempresa;
 QRelatorio.Open;
 QRLNomeEmpresa.Caption:=UpperCase(QRelatorio.fieldByname('Razao').AsString);


end;

procedure TFRelatorioOcorrenciaVendaNotaFiscal.QuickRep1EndPage(
  Sender: TCustomQuickRep);
begin
  inherited;
  if encolhe then
   QRBand1.Height:=105
  else
   QRBand1.Height:=175;
end;

procedure TFRelatorioOcorrenciaVendaNotaFiscal.QRBand1BeforePrint(
  Sender: TQRCustomBand; var PrintBand: Boolean);
begin
  inherited;
 encolhe:=false;
 
end;

procedure TFRelatorioOcorrenciaVendaNotaFiscal.QRBand3BeforePrint(
  Sender: TQRCustomBand; var PrintBand: Boolean);
begin
  inherited;
 encolhe:=true;

end;

procedure TFRelatorioOcorrenciaVendaNotaFiscal.QRLabel3Print(
  sender: TObject; var Value: String);
begin
  inherited;
value:='';
end;

end.
